import 'package:json_annotation/json_annotation.dart';

part 'User.g.dart';

/// create by longxiang.guo
@JsonSerializable()
class User {

  @JsonKey(defaultValue: "mock user name")
  final String name;

  @JsonKey(ignore: true)
  final String country = "China";

  @JsonKey(nullable: false)
  final String password;

  final int age;

  User(this.name, this.password, this.age);

  factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);

  Map<String, dynamic> toJson() =>  _$UserToJson(this);
  
}